package cn.chengpengper.nacos.client.properties;

import java.util.Properties;

public class JvmArgsPropertySource extends AbstractPropertySource {

    private final Properties properties;

    public JvmArgsPropertySource() {
        this.properties = System.getProperties();
    }

    @Override
    SourceType getType() {
        return SourceType.JVM;
    }

    @Override
    String getProperty(String key) {
        return properties.getProperty(key);
    }

    @Override
    boolean containsKey(String key) {
        return properties.containsKey(key);
    }

    @Override
    Properties asProperties() {
        Properties cloneProperties = new Properties();
        cloneProperties.putAll(this.properties);
        return cloneProperties;
    }
}
